package com.mercury.kafka.controller;


import com.mercury.kafka.domain.KafKaMqMessage;
import com.mercury.kafka.manager.KafkaManager;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author mercury
 */
@RestController
public class KafkaController {


    @Resource
    private KafkaManager kafkaManager;


    @GetMapping("/sendMsg")
    public void show() {

        KafKaMqMessage message = new KafKaMqMessage();
        message.setData("mercury");

        kafkaManager.sendMsg("topic-mercury", message);
    }
}
